#include"namedPipe.hpp"
int main()
{
    NamedPipe myfifo(Creater);
    if(myfifo.OpenForSeverRead()){
        std::cout << "sever open NamedPipe done" << std::endl;
        sleep(3);
        while (true)
        {
            std::string message;
            int n = myfifo.ReadNamedPipe(&message);
            if(n > 0){
                std::cout << "Client Say:"<<message << std::endl;
            }
            else if(n = 0){
                std::cout << "Client quit,sever too!" << std::endl;
                break;
            }
            else{
                std::cout << "myfifo.ReadNamedPipe Error" << std::endl;
                break;
            }
        }
    }
}